import { defHttp } from '/@/utils/http/axios'

import { OrderOutVO,OrderBackVO, OrderSO,InventoryVO } from './model/orderModel'
import { BasicFetchResult, BasicPageParams } from '/@/api/model/baseModel'

enum Api {
  pageOrderOut = '/order/out/page',
  pageOrderBack = '/order/back/page',
  pageInventory = '/inventory/page'
}

export const pageOrderOut = (data: BasicPageParams<OrderSO>) => {
  return defHttp.post<BasicFetchResult<OrderOutVO>>(
    { url: Api.pageOrderOut, data },
    { errorMessageMode: 'none' },
  )
}

export const pageOrderBack = (data: BasicPageParams<OrderSO>) => {
  return defHttp.post<BasicFetchResult<OrderBackVO>>(
    { url: Api.pageOrderBack, data },
    { errorMessageMode: 'none' },
  )
}

export const pageInventory = (data: BasicPageParams<OrderSO>) => {
  return defHttp.post<BasicFetchResult<InventoryVO>>(
    { url: Api.pageInventory, data },
    { errorMessageMode: 'none' },
  )
}